package com.jpa;

import com.jpa.config.TenantContext;
import com.jpa.jooq.tables.daos.EuclidAssetsLedgerDao;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @Autor: songfei
 * @Description:
 * @Date: Created in 10:34 2025/4/14
 **/
@Service
public class LoadService {

    @Autowired
    EuclidAssetsLedgerDao eudDao;

    @PostConstruct
    public void init() {
        ArrayList<String> tenantList = new ArrayList<>();
        tenantList.add("ISIC");
        tenantList.add("PA001");
        tenantList.add("PA002");
        tenantList.add("PA003");
        tenantList.forEach(item->{
            TenantContext.setCurrentTenant(item);
            eudDao.fetchOneById(1);
            TenantContext.clearCurrentTenant();
        });
    }
}
